package Java8实战.Lambda实战._5_函数符合;

import Java8实战.Lambda实战.Letter;

import java.util.function.Function;

public class _5_函数复合 {

    public static void main(String[] args) {

        Function<String,String> addHeader = Letter::addHeader;
        Function<String,String> transformationPipeline = addHeader.andThen(Letter::checkSpelling)
                .andThen(Letter::addFooter);

       String str = transformationPipeline.apply("\nHello world!\n");

       System.out.println(str);
    }
}
